package cc.sunwl.study.java8.异步编程.util;

import java.util.Random;

public class CommonUtils {
    public static void delay() {
        try {
            System.out.println("当前线程为：" + Thread.currentThread().getName());
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    public static void delayV2() {
        int delay = new Random().nextInt(2000);
        try {
            Thread.sleep(delay);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
